# Maintainer: BlackIkeEagle <ike DOT devolder AT gmail DOT com>

pkgname=kodi-addon-imagedecoder-heif
pkgver=20.1.0
_codename=Nexus
pkgrel=5
pkgdesc="Kodi heif/heic imagedecoder addon"
arch=('loong64' 'x86_64')
url="https://github.com/xbmc/imagedecoder.heif"
license=('GPL2')
groups=('kodi-addons' 'kodi-addons-imagedecoder')
makedepends=('cmake' 'kodi-dev' 'libheif' 'tinyxml2')
options=(!lto)
source=("$pkgname-$pkgver.tar.gz::https://github.com/xbmc/imagedecoder.heif/archive/refs/tags/$pkgver-$_codename.tar.gz")
sha512sums=('9e481b52aeb1373164a4f60059730620b812ef944dd56c500a603b4dd0cb2974cb72eb0968277c678287dd8b946f83ee37b8c54bc84172f1451b0c04ca6984f3')

build() {
    cd "imagedecoder.heif-$pkgver-$_codename"
    cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=1 \
        -DUSE_LTO=1 \
        .
    make
}

package() {
    depends=('kodi' 'libheif' 'tinyxml2')
    cd "imagedecoder.heif-$pkgver-$_codename"
    make DESTDIR="$pkgdir/" install
}
